package org.ch02.entity;

import javax.xml.crypto.Data;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @author CSY
 * @date 2025 - 02 - 26
 */
public class Staffs {
    private int id;
    private String name;
    private int age;
    private String phone;
    /**
     * 职位
     */
    private String staPos;
    private Date addTime;
    private Date updateTime;

    public Staffs() {}

    public Staffs(int id, String name, int age, String phone, String staPos, Date addTime, Date updateTime) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.phone = phone;
        this.staPos = staPos;
        this.addTime = addTime;
        this.updateTime = updateTime;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getStaPos() {
        return staPos;
    }

    public void setStaPos(String staPos) {
        this.staPos = staPos;
    }

    public Date getAddTime() {
        return addTime;
    }

    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return "Staff{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", phone='" + phone + '\'' +
                ", staPos='" + staPos + '\'' +
                ", addTime=" + sdf.format(addTime) +
                ", updateTime=" + sdf.format(updateTime) +
                '}';
    }
}
